package experiment1.sort;


import java.util.Arrays;
import java.util.Random;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Random random = new Random();
        Scanner scanner = new Scanner(System.in);
        int n;
        while ((n = scanner.nextInt()) != -1) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = random.nextInt(n);
            }
            if(arr.length <= 100)
                System.out.println("Original array:" + Arrays.toString(arr));

            QuickSort quickSort = new QuickSort(arr);
            System.out.println(quickSort.sortTime());
            MergeSort mergeSort = new MergeSort(arr);
            System.out.println(mergeSort.sortTime());
            BubbleSort bubbleSort = new BubbleSort(arr);
            System.out.println(bubbleSort.sortTime());
        }


    }
}
